(function() {
	var session = Math.floor(Math.random() * 100000);
	var servers = [
		"http://122.49.0.241:8080/", // BJ
		"http://114.80.70.166:8080/", // SH
		"http://182.140.141.252:8080/", // CD
		"http://113.108.217.165:8080/", // GZ
		"http://211.157.17.70:8080/", // SH-2
	];
	var images = [];

	function ping(indx) {
		var root_uri = servers[indx];
		var img = new Image();
		var tim;
		img.onload = function() {
			var img2 = new Image();
			var tim2 = new Date().valueOf();
			img2.src = [root_uri, "log?", ['10k.jpg', session, tim, tim2, (tim2 - tim)].join()].join('');
			images[indx] = img2;
		};
		tim = new Date().valueOf();
		img.src = [root_uri, "10k.jpg?", [session, tim].join()].join('');
		images[indx] = img;
	}
	
	var pcount = 0;
	var ptimer = setInterval(function() {
		ping(pcount++);
		if (!servers[pcount])
			clearInterval(ptimer);
	}, 1000);

})();
